package com.chuangke.sinotrukbudget.controller;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.chuangke.core.http.HttpResult;
import com.chuangke.sinotrukbudget.service.BudgetDingTalkTodoService;

/**
 * @author chuangke
 * @date 2022-10-20
 */
@RestController
@RequestMapping("budget/dingtalk")
public class BudgetDingTalkController {

	@Autowired
	private BudgetDingTalkTodoService budgetDingTalkTodoService;

//	@PreAuthorize("hasAuthority('login:action')")
	@GetMapping(value = "/revise")
	public HttpResult revise() {
		budgetDingTalkTodoService.reviseDingTalkTodo();
		return HttpResult.ok();
	}
	
	@GetMapping(value = "/handle")
	public HttpResult handleTodo() {
		List<String> handleDingTalkUserIdList = Arrays.asList("054589") ;
		budgetDingTalkTodoService.handleDingTalkTodo(handleDingTalkUserIdList);
		return HttpResult.ok();
	}

}
